{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from geoscilabs.dcip.DCWidgetResLayer2_5D import ResLayer_app\n",
    "from IPython.display import display\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from matplotlib import rcParams\n",
    "rcParams['font.size'] = 16"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Effects of a highly resisitive surface layer"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Purpose \n",
    "\n",
    "For a direct current resistivity (DCR) survey, currents are injected to the earth, and flow. \n",
    "Depending upon the conductivity contrast current flow in the earth will be distorted, and these changes \n",
    "can be measurable on the sufurface electrodes. \n",
    "Here, we focus on a cylinder target embedded in a halfspace below a highly resistive surface layer, and investigate what are happening in the earth when static currents are injected. Different from a sphere case, which is a finite target, the resistive layer will also impact the illumination of the target (conductor or resistor).\n",
    "By investigating changes in currents, electric fields, potential, and charges upon different geometry, Tx and Rx location, we understand geometric effects of the resistive layer for DCR survey. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Setup"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://github.com/geoscixyz/geosci-labs/blob/master/images/em/DC_ResLayer_Setup.png?raw=true\"> </img>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question\n",
    "\n",
    "- How does the cylinder affect the apparent resistivity without the resistive layer?\n",
    "- How does the resistive layer affect the apparent resistivity? Is there a difference if you add or remove the cylinder target?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plate model"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " - **survey**: Type of survey\n",
    " - **A**: Electrode A (+) location\n",
    " - **B**: Electrode B (-) location\n",
    " - **M**: Electrode A (+) location\n",
    " - **N**: Electrode B (-) location\n",
    " - **$dz_{layer}$**: thickness of the resistive layer\n",
    " - **$zc_{ayer}$**: z location of the resistive layer\n",
    " - **xc**: x location of cylinder center\n",
    " - **zc**: z location of cylinder center\n",
    " - **$\\rho_{1}$**: Resistivity of the half-space\n",
    " - **$\\rho_{2}$**: Resistivity of the layer\n",
    " - **$\\rho_{3}$**: Resistivity of the cylinder\n",
    " - **Field**: Field to visualize\n",
    " - **Type**: which part of the field\n",
    " - **Scale**: Linear or Log Scale visualization\n",
    " \n",
    "###  **Do not forget to hit Run Interact to update the figure after you made modifications**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ee6249c741ca4cf4a1ebe9d9269d9992",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "interactive(children=(ToggleButtons(description='survey', options=('Dipole-Dipole', 'Dipole-Pole', 'Pole-Dipol…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "app = ResLayer_app()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  },
  "widgets": {
   "state": {
    "4a242c6d21d24a68b2dbdf57fb68595b": {
     "views": [
      {
       "cell_index": 8
      }
     ]
    }
   },
   "version": "1.2.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
